package com.forum.user.handler;

import com.forum.common.utils.R;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class AllExceptionHandler {
    @ExceptionHandler(Exception.class)
    @ResponseBody
    public R doException(Exception ex){
        ex.printStackTrace();
        R r = new R();
        return r.put("系统异常",9999);
    }
}
